import {invoke} from "@tauri-apps/api/core";
import {useUserStore} from "../stores/user.ts";
import {storeToRefs} from "pinia";

export default async function loadFriends() {
    let {userInfo} = storeToRefs(useUserStore());
    let friends:Array<object> = [];
    await invoke("friend_list", {account: userInfo.value.account}).then((res) => {
        friends = res;
    }).then(() => {

    });
    console.log("load_friends: " + JSON.stringify(friends));
    return friends;
}